home *** CD-ROM | disk | FTP | other *** search
Java Source | 2003-04-29 | 841 b | 36 lines |
- package com.jproxy.samples.rmi.test;
-
- import javax.naming.*;
- import java.rmi.*;
- import java.util.*;
-
- import com.jproxy.samples.interfaces.ITest;
-
- public class TestClient
- {
- public static void main(String[] args)
- {
- // System.setSecurityManager(new RMISecurityManager());
- // Hashtable env = new Hashtable();
- // env.put(Context.INITIAL_CONTEXT_FACTORY, "com.jproxy.proxy.NamingContextFactory");
- // env.put(Context.PROVIDER_URL, "localhost");
- try {
-
- InitialContext context = new InitialContext();
- ITest test = (ITest) context.lookup("test");
-
- System.out.println(
- "\r\n**********************************"+
- "\r\nRMI Test CLIENT"+
- "\r\nServer Time: "+(new Date(test.getServerTime()))+
- "\r\n**********************************\r\n");
-
- context.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-